Skip to content

Fix: Pull existing locality values from WB dataset - #8374

Merged
CarolineDenis merged 5 commits into
mainfrom
issue-8322
Aug 26, 2026
Merged

Fix: Pull existing locality values from WB dataset#8374
CarolineDenis merged 5 commits into
mainfrom
issue-8322

Conversation

@CarolineDenis

@CarolineDenis CarolineDenis commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #8322

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list
  • Add automated tests
  • Add a reverse migration if a migration is present in the PR
  • Add migration function to
    def fix_schema_config(stdout: WriteToStdOut | None = None):

Testing instructions

  • In the Workbench, upload a dataset that has columns mapped to locality.latitude1, locality.longitude1, locality.localityname, and geography ranks (locality.geography.$Country.name, etc.) or create one
  • Leave the latitude1 and longitude1 cells empty, but fill in the locality and geography cells with real values
  • Select one or more rows and click the "GEOLocate" button in the toolbar
  • Verify that the GEOLocate dialog opens with all fields (country, state, county, locality) filled

Summary by CodeRabbit

  • Bug Fixes

    • Improved locality geolocation processing and coordinate conversion.
    • Prevented invalid or incomplete latitude and longitude values from producing point data.
    • Added support for converting degree-minute-second coordinates with hemisphere indicators into decimal coordinates.
  • Tests

    • Added coverage for blank coordinates and formatted coordinate inputs.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 81706d31-c1ad-403f-816c-fa20d95a0640

📥 Commits

Reviewing files that changed from the base of the PR and between 01f1a2d and cd9d17b.

📒 Files selected for processing (2)
  • specifyweb/frontend/js_src/lib/components/WbToolkit/GeoLocate.tsx
  • specifyweb/frontend/js_src/lib/components/WbToolkit/__tests__/GeoLocate.test.ts

📝 Walkthrough

Walkthrough

Changes

GEOLocate data flow

Layer / File(s) Summary
Locality data builder
specifyweb/frontend/js_src/lib/components/WbToolkit/GeoLocate.tsx
Adds buildGeoLocateData, reads locality fields directly, parses coordinates into signed decimal degrees, and emits points only when both coordinates are available.
WorkBench integration and validation
specifyweb/frontend/js_src/lib/components/WbToolkit/GeoLocate.tsx, specifyweb/frontend/js_src/lib/components/WbToolkit/__tests__/GeoLocate.test.ts
Routes WorkBench row data through the new builder and tests preservation of locality data with blank coordinates plus formatted points with populated coordinates.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main fix: preserving existing locality values in the Workbench GEOLocate flow.
Linked Issues check ✅ Passed The changes address #8322 by reading locality fields independently of coordinates and adding tests for empty latitude/longitude.
Out of Scope Changes check ✅ Passed The added export, coordinate parsing refinement, and test coverage all support the GEOLocate fix and appear in scope.
Automatic Tests ✅ Passed PASS: Added tests/GeoLocate.test.ts covering empty-coordinate and parsed-coordinate cases, and Jest testMatch includes this filename.
Testing Instructions ✅ Passed The steps target WbToolkit GeoLocate, reproduce the blank-coordinate bug, and verify the expected locality fields, matching the changed behavior.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-8322

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Warning

One or more dependencies are approaching or past End-of-Life.
Please plan upgrades accordingly.

STATUS=WARNING
NODE_VERSION=20
NODE_CYCLE=20
EOL_DATE=2026-04-30
DAYS_REMAINING=-97

--- Node.js ---
Version: 20
EOL: 2026-04-30
Status: WARNING

STATUS=OK
PYTHON_VERSION=3.12
PYTHON_CYCLE=3.12
EOL_DATE=2028-10-31
DAYS_REMAINING=818

--- Python ---
Version: 3.12
EOL: 2028-10-31
Status: OK

STATUS=WARNING
DJANGO_VERSION=4.2
DJANGO_CYCLE=4.2
EOL_DATE=2026-04-07
DAYS_REMAINING=-120

--- Django ---
Version: 4.2
EOL: 2026-04-07
Status: WARNING


@CarolineDenis

Copy link
Copy Markdown
Contributor Author

@CodeRabbit full review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 58 minutes.

Triggered by 3afee39 on branch refs/heads/issue-8322

@emenslin emenslin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Verify that the GEOLocate dialog opens with all fields (country, state, county, locality) filled

Looks good, works correctly!

@emenslin
emenslin requested a review from a team August 20, 2026 13:50

@grantfitzsimmons grantfitzsimmons left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • In the Workbench, upload a dataset that has columns mapped to locality.latitude1, locality.longitude1, locality.localityname, and geography ranks (locality.geography.$Country.name, etc.) or create one
  • Leave the latitude1 and longitude1 cells empty, but fill in the locality and geography cells with real values
  • Select one or more rows and click the "GEOLocate" button in the toolbar
  • Verify that the GEOLocate dialog opens with all fields (country, state, county, locality) filled

🌐 😄

@kwhuber kwhuber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • In the Workbench, upload a dataset that has columns mapped to locality.latitude1, locality.longitude1, locality.localityname, and geography ranks (locality.geography.$Country.name, etc.) or create one
  • Leave the latitude1 and longitude1 cells empty, but fill in the locality and geography cells with real values
  • Select one or more rows and click the "GEOLocate" button in the toolbar
  • Verify that the GEOLocate dialog opens with all fields (country, state, county, locality) filled

Locality string parsing throws off the pin sometimes, but the fix's overall functionality is correct again!

Image

@CarolineDenis
CarolineDenis merged commit a897a54 into main Aug 26, 2026
24 checks passed
@CarolineDenis
CarolineDenis deleted the issue-8322 branch August 26, 2026 07:23
@github-project-automation github-project-automation Bot moved this from 📋Back Log to ✅Done in General Tester Board Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

WorkBench GEOLocate requires non-empty latitude1/longitude1 values to pass any data

4 participants